package com.itlong.cloud.POJO.DTO.operate;

import com.itlong.cloud.POJO.DTO.BaseDTO;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <desc>
 *      证书管理相关接口查询参数DTO
 * </desc>
 *
 * @createDate2020/9/17
 **/
@Data
@NoArgsConstructor
public class OperateLicenseDTO extends BaseDTO {
    private String pcInfo;      //特征码信息
    private Integer status;     //状态 1启用 2禁用
    private String orderColumn; //排序字段
    private String orderRule;   //排序规则
    private String operateFunction; //操作菜单
    private String operateWay;  //操作功能
    private String ip;          //ip地址
    private String securityCode;    //安全码
    private Integer licenseType;        //证书类型 1正式证书 2工程调试证书
    private Integer source;         //来源 1在线获取 2人工添加

    /**
     * <desc>
     *      获取状态字符串
     * </desc>
     *
     * @Author Zhu.yj
     * @createDate  2020/9/18
     */
    public String getStatusString(){
        String statusString = "";
        if (status == null){
            status = 0;
        }
        switch (status){
            case 1:
                statusString =  "启用";
                break;
            case 2:
                statusString =  "禁用";
                break;
                default:
                    statusString = "无";
        }
        return statusString;
    }

    /**
     * <desc>
     *      获取来源字符串
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2020/9/28
     */
    public String getSourceString(){
        String sourceString = "";
        if (source == null){
            source = 0;
        }
        switch (source){
            case 1:
                sourceString =  "在线获取";
                break;
            case 2:
                sourceString =  "人工添加";
                break;
            default:
                sourceString = "无";
        }
        return sourceString;
    }
}
